<?php
class PartnerCatRaiting extends CActiveRecord {

    public $catid;
    public $type;
    public $val;
    
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public function tableName() {
        return 'partners_catraitings';
    }
    
    public function beforeDelete() {
        if(!parent::beforeDelete()) return false;
        
        PartnerRaiting::model()->deleteAll(array('catRatingId'=>$this->primaryKey));
        
        return true;
    }
}
